<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page import="java.util.*"%>
<%@ page import="org.book.dao.*"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>尚硅谷会员注册页面</title>
<link type="text/css" rel="stylesheet" href="static/css/css.css">
</head>
<body>
<div class="header">
		<ul>
			<li><a href="BooksServlet">Home</a></li>
			<li><a href="BorrowServlet">借阅信息</a></li>
			<li><a href="UsersServlet">用户信息</a></li>
		</ul>
		<div class="center-right">
            <form action="BorrowServlet" method="post">
                <input class="input" type="text" name="textName" placeholder="即刻搜索..">
                <input class="input2" type="submit" value="搜索">
            </form>
        </div>
</div>
		<table class="tab_1">
		<tr>
			<th>id</th>
			<th>借阅时间</th>
			<th>归还时间</th>
			<th>书籍编号</th>
			<th>书籍名称</th>
			<th>借阅人卡号</th>
			<th>借阅人</th>
			<th colspan="3">操作</th>
		</tr>

		<%
			Object obj = request.getAttribute("list");
			
		
			if(obj==null){
				request.getRequestDispatcher("../../index.jsp").forward(request, response);
				return ;
			}
		
			List<BorrowBean> list = (List<BorrowBean>)obj;
			
			int pageCurrent = (Integer)(request.getAttribute("pageCurrent"));
			int count = (Integer)(request.getAttribute("count"));
			for (BorrowBean borrowBean : list) {
		%>
		<tr>
			<td><%=borrowBean.getRecord_id()%></td>
			<td><%=borrowBean.getRentTime()%></td>
			<td><%=borrowBean.getReturnTime()%></td>
			<td><%=borrowBean.getISBN()%></td>
			<td><%=borrowBean.getBookName()%></td>
			<td><%=borrowBean.getCardNumber()%></td>
			<td><%=borrowBean.getUserName()%></td>
			<td><a href="BorrowUpdateServlet?no=<%=borrowBean.getRecord_id()%>&pageCurrent2=<%=pageCurrent%>">撤销</a>
			<td><a href="pages/home/borrowUpdate.jsp?no=<%=borrowBean.getRecord_id()%>&pageCurrent2=<%=pageCurrent%>">修改</a>
			<td><a href="BorrowUpdateServlet?record_id=<%=borrowBean.getRecord_id()%>">立即归还</a>
		</tr>
		<%
			}
		%>
	</table>
	<div class="boww">
		<ul>
	<li><a href="BorrowServlet">首页</a><li>
	<li><a href="BorrowServlet?pageCurrent=<%=pageCurrent==1?1:pageCurrent-1%>">上一页</a><li>
	<li><a href="BorrowServlet?pageCurrent=<%=pageCurrent==(count+9)/10?(count+9)/10:pageCurrent+1%>">下一页</a><li>
	<li><a href="BorrowServlet?pageCurrent=<%=(count+9)/10%>">尾页</a><li>
		</ul>
	</div>




</body>
</html>